<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmWorkOutTable extends Migration
{
    /**
     * Run the migrations.
     * 外出表
     * @return void
     */
    public function up()
    {
        //
        Schema::create('crm_work_out', function (Blueprint $table) {
            $table->engine='MyISAM';
            $table->comment='外出表';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('crm_uid')->unsigned()->default(0)->index('crm_uid')->comment('crm uid');
            $table->integer('crm_reviewer_uid')->unsigned()->default(0)->index('crm_reviewer_uid')->comment('审核人uid');
            $table->integer('crm_relation_comid')->unsigned()->index('crm_relation_comid')->comment('关联企业ＩＤ');
            $table->tinyInteger('reviewer_status')->unsigned()->default(0)->comment('审核状态：1表示审核，0未审核');
            $table->string('adress',250)->comment('外出地址');
            $table->timestamp('start_time')->index('start_time')->comment('外出开始时间');
            $table->timestamp('end_time')->index('end_time')->comment('外出结束时间');
            $table->string('remarks',250)->comment('外出备注');
            $table->string('review_remarks',250)->nullable()->comment('外出备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('crm_work_out');
    }
}
